# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-pexpect
_pkgname=pexpect
pkgver=4.8.0
pkgrel=4
pkgdesc='Allows easy control of interactive console applications.'
url='https://pypi.org/project/pexpect/#files'
arch=('any')
license=('MIT')
depends=('python2' 'python2-ptyprocess')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('7447ae2d1e13be422c894a8fd51c5aaa788e37ea7f0c798c88b77afd401fb3631400a637077ccbb83c2e3876b0d0c5e1dbd5fdc9d3739d785b4d5ad7c0192580')

prepare() {
  cd "$_pkgname-$pkgver"

  sed -i 's|env python|env python2|' "$_pkgname/FSM.py"
}

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

